package com.zhenfan.pattern;

/**
 * 折扣策略
 *
 * @author wangmh
 * @create 2018-11-08 14:52
 **/
public class DiscountStrategy implements SaleStrategy {

    private static final DiscountStrategy instance = new DiscountStrategy();

    private DiscountStrategy() {}

    public static DiscountStrategy getInstance() {
        return instance;
    }

    @Override
    public double getPaidAmount(double amount) {
        // 打8折
        System.out.println("打8折，应付：" + amount + "，实付：" + amount * 0.8);
        return amount * 0.8;
    }
}
